package good;


import BookModel.Year;

import com.thoughtworks.xstream.converters.SingleValueConverter;

public class YearConverter implements SingleValueConverter {

	@Override
	public Object fromString(String obj) {
		return new Year(obj);

	}

	@Override
	public String toString(Object year) {
		return ((Year) year).getYear();

	}

	@Override
	public boolean canConvert(Class type) {
		return type.equals(Year.class);
	}

}
